using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace AbstractFactoryPattern
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            TestUser();

            TestDepartment();
        }

        void TestUser()
        {
            IUser user = DataAccess.CreateUser();
            label1.Text = user.Add(new UserEntity());
            label1.Text += "\n" + user.GetUser(11);

            label1.Text += "\n\n";            
        }

        void TestDepartment()
        {
            IDepartment dept = DataAccess.CreateDepartment();
            label1.Text += dept.Add(new DepartmentEntity());
            label1.Text += "\n" + dept.GetDepartment(11);
        }
    }
}